import App from './App'
import VConsole from 'vconsole';
import cuCustom from '@/colorui/components/cu-custom.vue'
import api from "./api/api.js"
// 导入微信配置
import wechatConfig from '@/config/wechat.config.js'
// 导入微信工具
import wechatUtil from '@/utils/wechatUtil.js'
import uView from '@/node_modules/uview-ui'
import globalMixin from '@/utils/globalMixin';
// #ifndef VUE3
// #ifdef VUE3
import Vue, {createSSRApp} from 'vue'
import './uni.promisify.adaptor'

if ([109, 46, 123].includes(uni.getStorageSync('memberId') || null)) {
	const vConsole = new VConsole();
}
const config = {
	baseUrl: 'http://localhost:8080',
	// baseUrl: 'http://192.168.50.84:8080',
	// baseUrl: 'http://58.87.85.223:8080/api',
	// baseUrl: 'https://qinxintang.com/api',
	// 微信公众号AppID
	wxAppId: 'wxee39deb8d9fd37e3'
}

// 将配置挂载到全局
uni.$config = config

Vue.component('cu-custom', cuCustom)

Vue.prototype.$api = api;

uni.$wechatConfig = wechatConfig
Vue.prototype.$wechatUtil = wechatUtil

Vue.use(uView)

Vue.mixin(globalMixin);

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif